import {
  IsNotEmpty,
  IsNumber,
  IsOptional,
  IsString,
  Length,
} from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateMenuDto {
  @ApiProperty({ description: '菜单名称', example: '系统管理' })
  @IsString()
  @IsNotEmpty()
  @Length(2, 20)
  name: string;

  @ApiProperty({ description: '菜单路径', example: '/system' })
  @IsString()
  @IsNotEmpty()
  path: string;

  @ApiProperty({ description: '排序序号', required: false, example: 1 })
  @IsNumber()
  @IsOptional()
  order?: number;

  @ApiProperty({ description: '父级菜单ID', required: false, example: 1 })
  @IsNumber()
  @IsOptional()
  parentId?: number;
}
